package com.ychen.core.aop;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;


/**
 * @author chenyuliao
 * @version 1.0
 * @description
 * @date 2020/11/26 22:27
 */
public class LoggerHandler implements BeanPostProcessor {
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("开始初始化bean: " + beanName);
        return bean;
    }

    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("结束初始化bean: " + beanName);
        return bean;
    }
}
